<%--
功能: tag定义器
--%>
<%@ tag body-content="scriptless"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ attribute name="module"  rtexprvalue="true" type="java.lang.Short" description="模块id"%>
<%@ attribute name="selectorId" required="true" rtexprvalue="true" type="java.lang.String" description="selector id"%>
<%@ attribute name="callbackFunc" required="false" rtexprvalue="true" type="java.lang.String" description="回调函数"%>

<fmt:message key="tagList.heading" var="tagListTitle"/>	
<div id="divDlg${selectorId}" style="visibility:hidden;position:absolute;overflow: auto;">
	<div id="${selectorId}Iframe"  name="${selectorId}Iframe">
		<!-- 放置内容 fillDiv -->
	</div>
</div>

<c:set var="ui_dialog" value="true" scope="request"/>
<script type="text/javascript">

var ui_dialog_${selectorId};
var ${selectorId}Iframe = $j("#${selectorId}Iframe")[0];
var ${selectorId}CallbackFunc;
var ${selectorId}HasLoad = false;
$j(document).ready(function(){
	${selectorId}CallbackFunc = eval(${callbackFunc});
	ui_dialog_${selectorId} = $j("#divDlg${selectorId}"); 
}); 

//模拟重写打开dialog方法
function showDialogOf${selectorId}()
{
	ui_dialog_${selectorId}.css("visibility","visible");
	if(!${selectorId}HasLoad){
		ui_dialog_${selectorId}.dialog({beforeclose:beforeclose, title:"${tagListTitle}", modal: true, resizable:false,height:500, width:400, bgiframe: true,overlay: { opacity: 0.5, background: "black" } });
		${selectorId}HasLoad = true;
	}	
	$j('#${selectorId}Iframe').loading().load(__ctxPath + "/other/tag/blank.html?module=${module}");
	ui_dialog_${selectorId}.dialog("open");
	
}

//模拟重写关闭dialog方法
function closeDialogOf${selectorId}()
{
	ui_dialog_${selectorId}.dialog("close");
}
//窗体关闭前的函数
function beforeclose(){
	${selectorId}CallbackFunc.call(this);
}

</script>